

require(graphics)

a1 = arima.sim(n = 200, list(order = 10, ar = c(0.8897, -0.4858),
            ma = c(-0.2279, 0.2488)),
          sd = sqrt(0.1796) )

plot.ts(a1)

# mildly long-tailed
arima.sim(n = 63, list(ar=c(0.8897, -0.4858), ma=c(-0.2279, 0.2488)),
          rand.gen = function(n, ...) sqrt(0.1796) * rt(n, df = 5))

# An ARIMA simulation
ts.sim <- arima.sim(list(order = c(1,1,0), ar = 0.7), n = 200)
ts.plot(ts.sim)


arima(lh, order = c(1,0,0))

# An ARIMA simulation
ts.sim <- arima.sim(list(order = c(5,2,0), ar = 0.7), n = 200)
ts.plot(ts.sim)


ap = AirPassengers



# bizarre le comportement de stl, elle n'arrive pas a gerer 
# l'augementation de saison. Passer au log, ou utiliser box-machin
trend = ap.stl$time.series[, "trend"]
season = ap.stl$time.series[, "seasonal"]

res = ap.stl$time.series[, "remainder"]


